package com.qf.listener;

import com.qf.pojo.User;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * 演示自定义数据消费，发送端采用异步发送方式发送
 */
//@Component
//@RocketMQMessageListener(consumerGroup="consumer-group1",topic="test2")
public class RocketMQListener3 implements RocketMQListener<User> {
    @Override
    public void onMessage(User message) {
        try {
            System.out.println("消费者3：" + message);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
